package exercises;

import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

public class CountMap {

    public static void main(String[] args) {
        String str1 = "a,b,c,b,d,e";
        String str2 = "c,a,c,e,e,d";
        List<String> strings = Arrays.asList();
        System.out.println(strings);
        String[] list1 = str1.split(",");
        System.out.println(Arrays.toString(list1));
        String[] list2 = str2.split(",");
        Map<String, Long> countMap1 = Arrays.stream(list1).collect(Collectors.groupingBy(p -> p, Collectors.counting()));
        for(String key : countMap1.keySet()){

            System.out.println(key + countMap1.get(key));

        }
        Map<String, Long> countMap2 = Arrays.stream(list2).collect(Collectors.groupingBy(p -> p, Collectors.counting()));
        System.out.println(countMap1);
        System.out.println(countMap2);
        System.out.println(countMap1);

        Integer[] a = new Integer[]{1,2,3,4};
        StringBuffer combination = new StringBuffer();
        System.out.println(combination.append('s'));
        String orderSeq = UUID.randomUUID().toString();
        System.out.println(orderSeq);
        Random rand = new Random();
        System.out.println(rand.nextInt(2));
    }
}
